<?php


namespace Gaoop\Bundle\ApiBundle\Annotation;


use Doctrine\Common\Annotations\Annotation\Attribute;
use Doctrine\Common\Annotations\Annotation\Attributes;
use Doctrine\Common\Annotations\Annotation\Target;

/**
 * Class ApiParam
 * @package App\Annotations
 *
 * @Annotation
 * @Target({"METHOD"})
 * @Attributes({
 *     @Attribute("name", type = "string"),
 *     @Attribute("require", type="boolean"),
 *     @Attribute("type", type="string"),
 *     @Attribute("comment", type="string"),
 *     @Attribute("example", type="string"),
 * })
 */
class ApiParam {

    /**
     * 参数名称
     * @Required
     * @var string
     */
    public $name;

    /**
     * 参数是否必须
     * @var bool
     */
    public $require = false;

    /**
     * 参数类型
     * @Required
     * @Enum({
     *     "string", "boolean",
     *     "integer", "double",
     *     "array", "mixed"
     * })
     * @var string
     */
    public $type;

    /**
     * 参数说明
     * @Required
     * @var string
     */
    public $comment;

    /**
     * 参数校验
     * @var string
     */
    public $validation;

    /**
     * 参数样例
     * @var string
     */
    public $example;

}